<?php

	//引用公共部分
include '../../../php/conn.php'; 
	//添加试题接口
	if($con)
	{
		if($_POST)
		{
			
			$DTid=$_POST['DTid'];
			$TMamid=$_POST['TMamid'];
			$TMPaperTopic=$_POST['TMPaperTopic'];
			$TMAnswerA=$_POST['TMAnswerA'];
			$TMAnswerB=$_POST['TMAnswerB'];
			$TMAnswerC=$_POST['TMAnswerC'];
			$TMAnswerD=$_POST['TMAnswerD'];
			$TMRightAnswers=$_POST['TMRightAnswers'];
			$IpoTime=date('y-m-d H:I:S');
		 
		
			 $sql="INSERT INTO `itempooltable`(`IPTid`, `DTid`, `TMamid`, `TMPaperTopic`, `TMAnswerA`, `TMAnswerB`, `TMAnswerC`, `TMAnswerD`, `TMRightAnswers`, `IpoTime`) VALUES (0,$DTid,$TMamid,'$TMPaperTopic','$TMAnswerA','$TMAnswerB','$TMAnswerC','$TMAnswerD','$TMRightAnswers','$IpoTime')";
			 //print_r($sql);
			 //echo $uer_name,$uer_pwd,$uer_Emeli,$uer_phone,$uer_img;
			 
			$rs=mysql_query($sql);
			if($rs)
			{
				
				
				echo '{"staus":"200"}';
			}
			else
			{
				echo '{"staus":"500"}';
			
			}	
		}
		
		if($_GET)
		{
 
			
			
			$DTid=$_GET['DTid'];
			$TMamid=$_GET['TMamid'];
			$TMPaperTopic=$_GET['TMPaperTopic'];
			$TMAnswerA=$_GET['TMAnswerA'];
			$TMAnswerB=$_GET['TMAnswerB'];
			$TMAnswerC=$_GET['TMAnswerC'];
			$TMAnswerD=$_GET['TMAnswerD'];
			$TMRightAnswers=$_GET['TMRightAnswers'];
			$IpoTime=date('y-m-d H:I:S');
		 
		
			 $sql="INSERT INTO `itempooltable`(`IPTid`, `DTid`, `TMamid`, `TMPaperTopic`, `TMAnswerA`, `TMAnswerB`, `TMAnswerC`, `TMAnswerD`, `TMRightAnswers`, `IpoTime`) VALUES (0,$DTid,$TMamid,'$TMPaperTopic','$TMAnswerA','$TMAnswerB','$TMAnswerC','$TMAnswerD','$TMRightAnswers','$IpoTime')";
			 //print_r($sql);
			 //echo $uer_name,$uer_pwd,$uer_Emeli,$uer_phone,$uer_img;
			 
			$rs=mysql_query($sql);
			if($rs)
			{
				
				
				echo '{"staus":"200"}';
			}
			else
			{
				echo '{"staus":"500"}';
			
			}	
		}
	}
	else
	{
		//链接数据库失败
		echo '{"status":"0"}';
	}
	
	//关闭数据库
	mysql_close($con);
	  
?>